from asf_struct import *
from ctypes import *
import asf_common

#====================Api接口映射定义====================
#主要定义函数的入参与返回类型

#在线激活Api
online_activate = asf_common.face_engine_dll.ASFOnlineActivation
online_activate.restype = c_int32
online_activate.argtypes = (c_char_p, c_char_p, c_char_p)

#引擎初始化Api
init_engine = asf_common.face_engine_dll.ASFInitEngine
init_engine.restype = c_int32
init_engine.argtypes = (c_long, c_int32, c_int32, c_int32, POINTER(c_void_p))

#人脸检测Api
detect_face = asf_common.face_engine_dll.ASFDetectFaces
detect_face.restype = c_int32
detect_face.argtypes = (c_void_p, c_int32, c_int32, c_int32, POINTER(c_ubyte), POINTER(ASFMultiFaceInfo))

#人脸扩展信息识别Api（例如年龄、性别、口罩等等）
process = asf_common.face_engine_dll.ASFProcess
process.restype = c_int32
process.argtypes = (c_void_p, c_int32, c_int32, c_int32, POINTER(c_ubyte), POINTER(ASFMultiFaceInfo), c_int32)

#获取年龄Api
get_age = asf_common.face_engine_dll.ASFGetAge
get_age.restype = c_int32
get_age.argtypes = (c_void_p, POINTER(ASFAgeInfo))

#获取性别Api
get_gender = asf_common.face_engine_dll.ASFGetGender
get_gender.restype = c_int32
get_gender.argtypes = (c_void_p, POINTER(ASFGenderInfo))

#人脸质量检测Api
image_quality_detect = asf_common.face_engine_dll.ASFImageQualityDetect
image_quality_detect.restype = c_int32
image_quality_detect.argtypes = (c_void_p, c_int32, c_int32, c_int32, POINTER(c_ubyte), POINTER(ASFSingleFaceInfo), c_int32,POINTER(c_float), c_int32)
#=======================================================